package org.flexthinker.binding.conversion
{
    /**
     * A <code>Converter</code> is responsible to convert a value from one type into another type
     * or simply from one type into the same type, but with some extra logic.
     * <p>
     * An example of a convertion between 2 objects of the same type, would be
     * a Number representing the temperature in Celsius that needs to be converted
     * into another Number representing the temperature in Fahrenheit.
     * </p>
     */
    public interface Converter
    {
        /**
         * Converts a Binding's source into a Binding's target.
         * Converts the given <code>value</code> into another value.
         * @param value
         *          The value to convert.
         * @return
         *      The converted value
         */
        function convertForward(value:*):*;

        /**
         * Converts a Binding's target into a Binding's source.
         * Converts the given <code>value</code> into another value.
         * @param value
         *          The value to convert.
         * @return
         *      The converted value
         */
        function convertReverse(value:*):*;
    }
}
